<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Data Driven Substructure: Tensor&lt; T &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Data Driven Substructure
   
   </div>
   <div id="projectbrief">A library for carrying out Multivariate Kernel Smoothing--designed to be fast and flexible for large data processing.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">Tensor&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="Tensor" -->
<p>class for manipulating tensors  
 <a href="classTensor.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="tensor_8h_source.html">tensor.h</a>&gt;</code></p>

<p><a href="classTensor-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae966f3807d5bfb78c049cf8c494e16ba"></a><!-- doxytag: member="Tensor::Tensor" ref="ae966f3807d5bfb78c049cf8c494e16ba" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#ae966f3807d5bfb78c049cf8c494e16ba">Tensor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">default constructor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a478b7c1715eff249a23e422fecf645fd"></a><!-- doxytag: member="Tensor::Tensor" ref="a478b7c1715eff249a23e422fecf645fd" args="(int rank_, int *length_)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a478b7c1715eff249a23e422fecf645fd">Tensor</a> (int rank_, int *length_)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">constructor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c8059476d25909348ebbb4ed862e172"></a><!-- doxytag: member="Tensor::Tensor" ref="a9c8059476d25909348ebbb4ed862e172" args="(const valarray&lt; int &gt; &amp;length_)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a9c8059476d25909348ebbb4ed862e172">Tensor</a> (const valarray&lt; int &gt; &amp;length_)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">safer constructor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3edf1ff2c8d72b4d0c216fa37ecd83b9"></a><!-- doxytag: member="Tensor::Length" ref="a3edf1ff2c8d72b4d0c216fa37ecd83b9" args="(int i) const " -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a3edf1ff2c8d72b4d0c216fa37ecd83b9">Length</a> (int i) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">access length of a particular dimension <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ddb04a0ee784b1772452d5b6c2f4331"></a><!-- doxytag: member="Tensor::Rank" ref="a2ddb04a0ee784b1772452d5b6c2f4331" args="() const " -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a2ddb04a0ee784b1772452d5b6c2f4331">Rank</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return rank of tensor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#acd6d6e03c121c5d084981e05d4418464">operator[]</a> (const valarray&lt; int &gt; &amp;ntuple)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a3fcfaa1fc021198496480f68c0071f6b">operator[]</a> (const valarray&lt; int &gt; &amp;ntuple) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a2c4c22e1ef1c198a7494740fb55dd148">operator[]</a> (int)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a38a544492b07a2ec06b3c86d94ebb293">operator[]</a> (int) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a65f3440129fa379cfa7de78cede43c5d"></a><!-- doxytag: member="Tensor::size" ref="a65f3440129fa379cfa7de78cede43c5d" args="() const " -->
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a65f3440129fa379cfa7de78cede43c5d">size</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return size of array <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d360c725767f6ff5f2ac8fb5f9f4952"></a><!-- doxytag: member="Tensor::IndexVec" ref="a8d360c725767f6ff5f2ac8fb5f9f4952" args="(int index) const " -->
valarray&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a8d360c725767f6ff5f2ac8fb5f9f4952">IndexVec</a> (int index) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return a vector from an index <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aafec9bc95c7876c2738c46737f032e89"></a><!-- doxytag: member="Tensor::Index" ref="aafec9bc95c7876c2738c46737f032e89" args="(const valarray&lt; int &gt; &amp;index) const " -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#aafec9bc95c7876c2738c46737f032e89">Index</a> (const valarray&lt; int &gt; &amp;index) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return an index from a vector <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa88e8d6a7dd4670effc5b8ea2a424173"></a><!-- doxytag: member="Tensor::ValidIndex" ref="aa88e8d6a7dd4670effc5b8ea2a424173" args="(int) const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#aa88e8d6a7dd4670effc5b8ea2a424173">ValidIndex</a> (int) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">see if index is within range <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#ac642341771abe61b6de65f11a9cf2f30">GridDistance</a> (int index1, int index2) const </td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#ace6f80048f9cf60f267a371bd8480a54">initialize_index_herlper</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd98e501acb62ff8617df796320bdefc"></a><!-- doxytag: member="Tensor::ary" ref="abd98e501acb62ff8617df796320bdefc" args="" -->
valarray&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#abd98e501acb62ff8617df796320bdefc">ary</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">valarray to store data <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf6ecd9801e5de52c9e5255cbb4d1604"></a><!-- doxytag: member="Tensor::rank" ref="abf6ecd9801e5de52c9e5255cbb4d1604" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#abf6ecd9801e5de52c9e5255cbb4d1604">rank</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">rank/dimension of tensor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9aef126f2198b62037f8f7d2fdc68905"></a><!-- doxytag: member="Tensor::length" ref="a9aef126f2198b62037f8f7d2fdc68905" args="" -->
valarray&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#a9aef126f2198b62037f8f7d2fdc68905">length</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">array to store the length of each dimension <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">valarray&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTensor.html#adaabaacb5b35a56b4f50f5b944d52501">index_helper</a></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef648af6c56fa8ee0738c93629e725dc"></a><!-- doxytag: member="Tensor::DataSet" ref="aef648af6c56fa8ee0738c93629e725dc" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>DataSet</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42f46c0d6172e9a1b2f02325dd0137cf"></a><!-- doxytag: member="Tensor::PDF" ref="a42f46c0d6172e9a1b2f02325dd0137cf" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>PDF</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br/>
class Tensor&lt; T &gt;</h3>

<p>class for manipulating tensors </p>
<p>Implementation of multi-dimensional tensor via valarray, need not be squre. This is used as a multi-dimensional histogram </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac642341771abe61b6de65f11a9cf2f30"></a><!-- doxytag: member="Tensor::GridDistance" ref="ac642341771abe61b6de65f11a9cf2f30" args="(int index1, int index2) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::<a class="el" href="classTensor.html#ac642341771abe61b6de65f11a9cf2f30">GridDistance</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>a function to figure out the "grid" norm between two index, i.e. max(abs(xi-y-)) between two vector of indices function is unsafe (assuming index1 and index2) both make sense </p>

</div>
</div>
<a class="anchor" id="ace6f80048f9cf60f267a371bd8480a54"></a><!-- doxytag: member="Tensor::initialize_index_herlper" ref="ace6f80048f9cf60f267a371bd8480a54" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::<a class="el" href="classTensor.html#ace6f80048f9cf60f267a371bd8480a54">initialize_index_herlper</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>function to initialize index_helper used in access operator[] </p>

</div>
</div>
<a class="anchor" id="acd6d6e03c121c5d084981e05d4418464"></a><!-- doxytag: member="Tensor::operator[]" ref="acd6d6e03c121c5d084981e05d4418464" args="(const valarray&lt; int &gt; &amp;ntuple)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T &amp; <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">const valarray&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>ntuple</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>quick access elements of the tensor might return wrong elements if out of bound </p>

</div>
</div>
<a class="anchor" id="a3fcfaa1fc021198496480f68c0071f6b"></a><!-- doxytag: member="Tensor::operator[]" ref="a3fcfaa1fc021198496480f68c0071f6b" args="(const valarray&lt; int &gt; &amp;ntuple) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">const valarray&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>ntuple</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>quick const access elements of the tensor might return wrong elements if out of bound </p>

</div>
</div>
<a class="anchor" id="a2c4c22e1ef1c198a7494740fb55dd148"></a><!-- doxytag: member="Tensor::operator[]" ref="a2c4c22e1ef1c198a7494740fb55dd148" args="(int)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T &amp; <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>quick access elements of the tensor might return wrong elements if out of bound </p>

</div>
</div>
<a class="anchor" id="a38a544492b07a2ec06b3c86d94ebb293"></a><!-- doxytag: member="Tensor::operator[]" ref="a38a544492b07a2ec06b3c86d94ebb293" args="(int) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>quick const access elements of the tensor might return wrong elements if out of bound </p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="adaabaacb5b35a56b4f50f5b944d52501"></a><!-- doxytag: member="Tensor::index_helper" ref="adaabaacb5b35a56b4f50f5b944d52501" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">valarray&lt;int&gt; <a class="el" href="classTensor.html">Tensor</a>&lt; T &gt;::<a class="el" href="classTensor.html#adaabaacb5b35a56b4f50f5b944d52501">index_helper</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>array to help get tensor element its elements are [lengthn*length(n-1)*...*length1, length(n-1)*...*length1, ..., length1] to grab an object in tensor with index=[n1, n2, n3..., nn] simply take the index dotproduct index_helper </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="tensor_8h_source.html">tensor.h</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Sep 12 2013 17:12:59 for Data Driven Substructure by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
